home *** CD-ROM | disk | FTP | other *** search
- PXFGETENV(3F) Last changed: 1-22-99
-
-
- NNAAMMEE
- PPXXFFGGEETTEENNVV - Returns a value for the environment name
-
- SSYYNNOOPPSSIISS
- SSUUBBRROOUUTTIINNEE PPXXFFGGEETTEENNVV ((_n_a_m_e,, _l_e_n_n_a_m_e,, _v_a_l_u_e,, _l_e_n_v_a_l,, _i_e_r_r_o_r))
- CCHHAARRAACCTTEERR**_n _n_a_m_e,, _v_a_l_u_e
- IINNTTEEGGEERR _l_e_n_n_a_m_e,, _l_e_n_v_a_l,, _i_e_r_r_o_r
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- UNICOS, UNICOS/mk, and IRIX systems
-
- DDEESSCCRRIIPPTTIIOONN
- On IRIX systems, this routine is in lliibbffoorrttrraann..ssoo which is linked by
- default when compiling programs with the MIPSpro 7 Fortran 90 compiler
- or when compiling programs with the --ccrraayylliibbss option to the MIPSpro
- F77 compiler.
-
- The PPXXFFGGEETTEENNVV subroutine uses the ggeetteennvv() function to search the
- environment list for a _n_a_m_e in a string of the form _n_a_m_e=_v_a_l_u_e.
-
- If _n_a_m_e matches a name in the list, the character representation of
- _v_a_l_u_e is stored in the _v_a_l_u_e character argument and the number of
- characters in _v_a_l_u_e is stored in _l_e_n_v_a_l. If the length of the value
- to be placed in _v_a_l_u_e is larger than the declared length of _v_a_l_u_e, the
- value string is truncated on the right and stored in _v_a_l_u_e. The
- nontruncated length is stored in _l_e_n_v_a_l and _i_e_r_r_o_r is set to eettrruunncc.
- If the length of the value is shorter than the declared size of _v_a_l_u_e,
- the value string is stored with left justification and filled with
- blanks on the right. _l_e_n_v_a_l is set to the shorter length of the value
- string.
-
- If _n_a_m_e is found but has no value, blanks are stored in _v_a_l_u_e and
- _l_e_n_v_a_l is set to zero. If _n_a_m_e cannot be found, EEIINNVVAALL is returned in
- _i_e_r_r_o_r.
-
- When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
- UNICOS, UNICOS/mk, or IRIX systems, all arguments must be of default
- kind unless documented otherwise. On UNICOS and UNICOS/mk, default
- kind is KKIINNDD==88 for integer, real, complex, and logical arguments; on
- IRIX, the default kind is KKIINNDD==44.
-
- The following is a list of valid arguments for this routine:
-
- _n_a_m_e An input character variable or array element containing the
- name of an environment variable.
-
- _l_e_n_n_a_m_e An input integer variable containing the length of _n_a_m_e in
- characters. If _l_e_n_n_a_m_e is zero, the trailing blanks are
- removed. The declared length of the input name is
- decremented by the number of blanks removed. If _l_e_n_n_a_m_e is
- zero and _n_a_m_e is all blanks, the input name is a null
- string.
-
- _v_a_l_u_e An output character variable or array element containing the
- value of the environment variable _n_a_m_e.
-
- _l_e_n_v_a_l An output integer variable containing the length of _v_a_l_u_e in
- characters. If _n_a_m_e is found but has no value, _l_e_n_v_a_l is
- zero and _v_a_l_u_e contains all blanks to indicate a null
- string. If the value representation is truncated to be
- stored in _v_a_l_u_e, _l_e_n_v_a_l contains the nontruncated length of
- value. If the value representation is shorter than the
- length of _v_a_l_u_e, _l_e_n_v_a_l contains the shorter length.
-
- _i_e_r_r_o_r An output integer variable containing the status:
-
- EEIINNVVAALL If _n_a_m_e is not in the environment list.
-
- EETTRRUUNNCC If the declared length of _v_a_l_u_e is insufficient to
- contain the string to be returned. The value of
- _n_a_m_e is truncated to fit in _v_a_l_u_e, and _l_e_n_v_a_l
- contains the original length of the value of _n_a_m_e
- before truncation.
-
- Zero ggeetteennvv is successful (if _n_a_m_e is found).
-
- EEXXAAMMPPLLEESS
- In this example, PPXXFFGGEETTEENNVV searches for a string containing
- SSHHEELLLL==_v_a_l_u_e.
-
- program testpxf
- character*24 namea, nameb
- integer lena, lenb, ier
- c set input arguments
- ier = 0
- lena=0
- lenb=0
- namea='SHELL'
- nameb=' '
- CALL PXFGETENV (namea, lena, nameb, lenb, ier)
- print *,'TEST results:'
- c print input arguments
- print *,'namea=-',namea,'-'
- print *,'lena=',lena
- c print output arguments
- print *,'nameb=-',nameb,'-'
- print *,'lenb=',lenb
- print *,'ier=',ier
- end
-
- If the string is found, it may return:
-
- TEST results:
- namea=-SHELL
- lena=0
- nameb=-/bin/csh
- lenb=8
- ier=0
-
- SSEEEE AALLSSOO
- ggeetteennvv(3C)
-
- _A_p_p_l_i_c_a_t_i_o_n _P_r_o_g_r_a_m_m_e_r'_s _L_i_b_r_a_r_y _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed
- version of this man page.
-